{% extends "base/base.html" %}
{% block title %}Go Walker - {{Tr(Lang, "app_desc")}}{% endblock %}
{% block body %}
<div class="page-home text-center">
  <div class="hero">
    <div class="hero-body">
      <i class="fas fa-terminal fa-5x pb-2 hide-sm"></i>
      <h1>{{Tr(Lang, "home.hero_title", NumTotalPackages)}}</h1>
      <p>
        {% if Lang == "zh-CN" %}
          Go Walker 是一个可以在线生成并浏览 <a target="_blank" href="https://golang.org/">Go</a> 项目 API 文档的 Web 服务器，目前已支持包括 <b>GitHub</b> 等代码托管平台。
        {% else %}
          Go Walker is a server that generates <a target="_blank" href="https://golang.org/">Go</a> projects API documentation on the fly for the projects on <b>GitHub</b>.
        {% endif %}
      </p>

      <form class="form-autocomplete col-xs-12 col-7 col-mr-auto col-ml-auto" action="/search">
        <div class="input-group">
          <div class="form-autocomplete-input form-input">
            <input id="import-search" class="form-input" name="q" placeholder="{{Tr(Lang, "home.search_holder")}}" autocomplete="off" autofocus>
            <input type="hidden" name="auto_redirect" value="true">
            <ul class="menu text-left">
              <li id="search-results" class="menu-item">
              </li>
            </ul>
          </div>
          <button class="btn input-group-btn"><i class="fas fa-search"></i><div class="loading d-hide p-2"></div></button>
        </div>
      </form>
    </div>

    {% if BrowsingHistory %}
      <br><br>
      <div class="divider"></div>
      <br><br>

      <h2><i class="fas fa-list-ul"></i> {{Tr(Lang, "home.browse_history")}}</h2>
      <table class="table col-xs-12 col-8 col-mr-auto col-ml-auto">
        <tbody id="browse_history">
          {% for p in BrowsingHistory %}
            <tr>
              <td {% if p.ImportPath|length >= 40 %}class="popup" data-content="{{p.ImportPath}}"{% endif %}>
                <a href="/{{p.ImportPath}}">{{RearSubStr(p.ImportPath, 40)}}</a>
                {% if p.IsGoRepo %}
                <a class="label label-rounded" href="/search?q=gorepos">{{Tr(Lang, "home.standard")}}</a>
                {% endif %}
              </td>
              <td class="meta-time hide-sm">{{p.LastViewed}}</td>
            </tr>
          {% endfor %}
        </tbody>
      </table>
    {% endif %}
  </div>
</div>
{% endblock %}